/**
 * Created by kjmk on 2015/7/13.
 */
var fs = require("fs");
module.exports = Controller("Test/BaseController", function(){
    "use strict"
    return {
        cameraAction: function () {
            if(this.isPost()){

            }else{
                this.display();
            }
        },
        
        audioAction: function () {
            if(this.isPost()){
                var src = this.post("src");
                console.log(src);
                var base64str = src.substring(src.lastIndexOf("/") + 1 );
                console.log(base64str);
                var filename = "static/test1.wav";
                var data = new Buffer(base64str, "base64");
                fs.writeFileSync(filename, base64str);
                this.end("8899");
            }else{
                this.display();
            }
        }
    }
});